/**
 * Created by longgs on 2018-7-18.
 */
(function (angular) {
    function AlgorithmService($resource, $q, $http, UrlConfigService) {
        var _schema = [
            {label: '序号', name: "no", sortable: false},
            {label: '模型代码', name: "code", sortable: false},
            {label: '模型名称', name: "name", sortable: false},
            {label: '计算标签', name: "tag", sortable: false},
            {label: '算法', name: "algorithm", sortable: false},
            {label: '操作', type: 'template', templateUrl: 'operation.html', width: '213x'}
        ];
        this._schema = _schema;

        this._sort = '';
        this._order = '';
        this._listUrl = UrlConfigService.urlConfig.decisionAnalysis.portray.algorithm.list;
        this._url = UrlConfigService.urlConfig.decisionAnalysis.portray.algorithm.url;
        this._save = UrlConfigService.urlConfig.decisionAnalysis.portray.algorithm.save;
        this.save = function (model) {
            return $resource(this._save).save(model);
        }
        BaseListService.call(this, this._listUrl, $resource, $q, $http, _schema, this._url);

    }

    AlgorithmService.$inject = ['$resource', '$q', '$http', 'UrlConfigService'];
    angular.module('MetronicApp').service('AlgorithmService', AlgorithmService);
})(angular);